package com.adee.gulimall.product.service;

import com.adee.gulimall.common.utils.PageUtils;
import com.adee.gulimall.product.entity.AttrEntity;
import com.adee.gulimall.product.entity.ProductAttrValueEntity;
import com.adee.gulimall.product.vo.AttrGroupRelationReqVo;
import com.adee.gulimall.product.vo.AttrGroupRespVo;
import com.adee.gulimall.product.vo.AttrRespVo;
import com.adee.gulimall.product.vo.AttrVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author adee
 * @email 609980188@qq.com
 * @date 2022-08-19 16:28:50
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params, Long catelogId, String attrType);

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVo attr);

    AttrRespVo getAttrInfo(Long attrId);

    void updateAttr(AttrVo attr);

    // 根据分组id查找所有规则参数
    List<AttrEntity> getRelationAttr(Long attrGroupId);

    void deleteRelation(AttrGroupRelationReqVo[] attrList);

    // 获取当前分类中没有被其他分组关联的属性
    PageUtils getRelationAttrNo(Long attrGroupId, Map<String, Object> params);

    // 查询某个分类下所有分组及分组下所有基本属性
    List<AttrGroupRespVo> withattr(Long catelogId);

    String getNameById(Long attrId);

    List<ProductAttrValueEntity> queryBaseList4Spu(Long spuId);

    void updateAttrsBySpuId(List<ProductAttrValueEntity> attrs, Long spuId);
}

